Ext.define('Intranet.VeCongTy.view.MiniView', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.VeCongTy_MiniView',
    title: 'Ve Cong Ty',
    height: 300,
    tools: [{
            type: 'minimize',
            tooltip: 'Minimize',
            handler: function(event, toolEl, owner, tool) {
                owner.up('panel').collapse();
            }
        }, {
            type: 'restore',
            tooltip: 'Restore',
            handler: function(event, toolEl, owner, tool) {
                owner.up('panel').expand();
            }
        }, {
            type: 'maximize',
            tooltip: 'Maximize',
            handler: function(event, toolEl, owner, tool) {
                Ext.create('Ext.window.Window', {
                    title: 'Ve Cong Ty',
                    height: 500,
                    width: 800,
                    layout: 'fit',
                    items: {
                        xtype: 'VeCongTy_MainView'
                    }
                }).show();
            }
        }],
    layout: {
        type: 'hbox',
        align: 'stretch',
        padding: 10
    },
    items: [{
            xtype: 'container',
            margins: '0 10 10 0',
            flex: 7,
            layout: {
                type: 'vbox',
                align: 'stretch',
                animate: true
            },
            items: [{
                    xtype: 'panel',
                    margins: '0 0 7 0',
                    flex: 7,
                    title: 'Lien ket noi bo'
                }, {
                    xtype: 'panel',
                    flex: 3,
                    margins: '0 0 15 0',
                    title: 'Lien ket ngoai'
                }]
        }, {
            xtype: 'container',
            flex: 3,
            margins: '0 0 10 0',
            layout: {
                type: 'vbox',
                align: 'stretch',
                animate: true
            },
            items: [{
                    xtype: 'panel',
                    flex: 3,
                    margins: '0 0 7 0'
                }, {
                    xtype: 'panel',
                    flex: 7,
                    margins: '0 0 15 0',
                    layout: {
                        type: 'vbox',
                        align: 'stretchmax'
                    },
                    border: false,
                    defaults: {
                        flex: 1,
                        margins: '7 0 7 0'
                    },
                    items: [{
                            xtype: 'button',
                            text: 'So do'
                        }, {
                            xtype: 'button',
                            text: 'Gioi thieu'
                        }, {
                            xtype: 'button',
                            text: 'Quy dinh'
                        }, {
                            xtype: 'button',
                            text: 'Chinh sach'
                        }, {
                            xtype: 'button',
                            text: 'Huong dan'
                        }]
                }]
        }],
    
    listeners: {
        afterrender: function(thisCmp, opts){

            var panels = thisCmp.query('panel');
            
            for(var i = 0; i < panels.length; i++)
                {
                    if(panels[i].getHeader()){
                        panels[i].getHeader().getEl().applyStyles({
                            backgroundImage: "none",
                            backgroundColor: "#fff"
                        });
                    }
                }
        }
        
    }

});
